﻿using System;
using FreeSql.DataAnnotations;

namespace App.Model.Main
{
    /// <summary>
    /// 系统模块
    /// </summary>
    //[Table(Name = "sys_module")]
    [Index("mk_{tablename}_EnName", nameof(EnName), false)]
    public class SysModule : EntityBase<int>
    {
        /// <summary>
        /// 模块名 建议5个字以内
        /// </summary>
        [Column(StringLength = 20)]
        public string Name { get; set; }

        /// <summary>
        /// 英文名 平台内唯一
        /// </summary>
        [Column(StringLength = 200, IsNullable = false)]
        public string EnName { get; set; }

        /// <summary>
        /// 接口方法所在控制器名用来自动匹配权限 区分大小写
        /// </summary>
        [Column(StringLength = 200)]
        public string ControllerName { get; set; }

        /// <summary>
        /// 父模块id
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 页面url 也可不配置由前端根据英文名配置
        /// </summary>
        [Column(StringLength = 200)]
        public string RouterPath { get; set; }

        /// <summary>
        /// 模块图标 也可不配置由前端根据英文名配置
        /// </summary>
        [Column(StringLength = 200)]
        public string Icon { get; set; }

        /// <summary>
        /// 所属平台id
        /// </summary> 
        public int PlatformId { get; set; }
    }
}


